#Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/ebuildteam/net-misc/pcmanx/pcmanx-0.3.2.ebuild,v 1.2 2005/10/14 18:37:31 palatis Exp $

inherit eutils

DESCRIPTION="PCManX is an easy-to-use telnet client mainly targets BBS users formerly writen by gtk2"
SRC_URI="http://pcmanx.csie.net/release/pcmanx-pure-gtk2-${PV}.tar.gz"
HOMEPAGE="http://pcmanx.csie.net/"
RESTRICT="nomirror"

S="${WORKDIR}/pcmanx-pure-gtk2-${PV}"

KEYWORDS="x86 ~ppc amd64"
SLOT="0"
LICENSE="GPL"
IUSE="nsplugin"

DEPEND=">=x11-libs/gtk+-2.4
	virtual/x11
	!www-client/pcmanxplug-in
	!virtual/pcmanx"
PROVIDE="virtual/pcmanx"

src_compile() {
	local myconf=""
	use nsplugin && myconf="$myconf --enable-plugin"
	
	econf $myconf || die "econf failed"
	
	emake || die "emake failed"
}

src_install()
{
	cd $S
	make DESTDIR=${D} MOZILLA_LIB_DIR_SEARCH=/usr/lib/nsbrowser install
}

pkg_postinst()
{
	if use nsplugin
	then
		einfo "You have to restart your browser in order to take effect."
		einfo "if it doesn't work, please do:"
		einfo
		einfo "	# find ~ -type f -name compreg.dat -exec rm {} \;"
		einfo
	fi
}
